﻿Public Class frmDiagnostico

    Dim nomDiagnostico As String
    Dim codDiagnostico As Integer
    Dim bd As New BTTbdDataContext



    Private Sub frmDiagnostico_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim diagnostico = From diag In bd.diagnosticos _
                          Select diag

        Me.DiagnosticoBindingSource.DataSource = diagnostico

    End Sub

    Private Sub btnSeleccionar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSeleccionar.Click
        codDiagnostico = dgvDiagnostico.CurrentRow.Cells("idDiagnostico").Value
        nomDiagnostico = dgvDiagnostico.CurrentRow.Cells("diag_general").Value
        nomDiagnostico = nomDiagnostico + " " + dgvDiagnostico.CurrentRow.Cells("diag_especifico").Value

        Me.Close()

    End Sub

    Private Sub DiagnosticoBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DiagnosticoBindingNavigatorSaveItem.Click

        Try
            bd.SubmitChanges()
            MsgBox("Guardado")
        Catch ex As Exception
            MsgBox(ex.ToString)

        End Try
    End Sub

    Public Property _nomDiagnostico()
        Get
            Return Me.nomDiagnostico

        End Get
        Set(ByVal value)

            Me.nomDiagnostico = value

        End Set
    End Property

    Public Property _codDiagnostico()
        Get
            Return Me.codDiagnostico

        End Get
        Set(ByVal value)

            Me.codDiagnostico = value

        End Set
    End Property

   
End Class